package com.eliota.mapper;

import com.eliota.entity.ProjectDevice;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

import java.time.LocalDateTime;
import java.util.List;
import java.util.Map;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author MG
 * @since 2023-04-05
 */
@Mapper
public interface ProjectDeviceMapper extends BaseMapper<ProjectDevice> {

    List<ProjectDevice> selectProjectDevice( Map<String, Object> params);

    @Update("update project_device set project_device.status = 0 where project_device.id = #{id}")
    void downStatus(Integer id);


    @Update("update project_device set project_device.status = 1 where project_device.id = #{id}")
    void ipStatus(Integer id);

    @Update("update project_device set end_time = #{now} where id = #{id}")
    void updateEndTime(LocalDateTime now,Integer id);
}
